<%@page import="com.hdl.entity.HdlUser"%>
<%@ page language="java" pageEncoding="UTF-8"%>
<header class="m-hd">
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<jsp:include page="/head.jsp"></jsp:include>
<style>
		.m-hd .m-nav a{
			color:white;
		}
		.outlog{
		display:none;
		position:relative;
		background-color:#ba1f2e;
		text-align:center;
		}
		.login:hover .outlog{
		display:block;
		left:40px;
		top:-22px;
		}
		.user{
		display:inline-block;
		backgroud-color: #ba1f2e;
		}
</style>
	<section data-am-sticky class="am-show-md-up">
		<div class="am-container">
			<a href="/" rel="nofollow" class="m-logo"><i
				class="am-icon-spinner"></i>haidel</a>
			<!--        <ul class="am-fr m-about">
                <li><a href="/about/" class="am-btn am-btn-danger am-btn-sm am-radius" rel="nofollow">关于我们</a></li>
                <li><a href="/contact/" class="am-btn am-btn-danger am-btn-sm am-radius" rel="nofollow">联系我们</a></li>
            </ul> -->
			<nav>
				<ul class="m-nav am-nav am-nav-pills am-fr">
					<li><a href="index.jsp" rel="nofollow">首页</a></li>
					<li class="am-dropdown" data-am-dropdown><a href="/anli.jsp"
						rel="nofollow" class="am-dropdown-toggle" data-am-dropdown-toggle>美食点餐
							<span class="am-icon-caret-down"></span>
					</a>
						<ul class="am-dropdown-content" id="meishi">
						
							<!-- <li><a href="meishi.jsp" rel="nofollow">锅底</a></li>
							<li><a href="meishi2.jsp" rel="nofollow">涮菜</a></li>
							<li><a href="meishi3.jsp" rel="nofollow">特色蘸料</a></li>
							<li><a href="meishi4.jsp" rel="nofollow">小吃甜品</a></li>
							<li><a href="meishi5.jsp" rel="nofollow">特色饮品</a></li> -->
						</ul>
						</li>
					<li><a href="fuwu.jsp" rel="nofollow">服务中心</a></li>
					<li><a href="zixun-page1.let" rel="nofollow">最新动态</a></li>
					<li><a href="about.jsp" rel="nofollow">关于嗨底捞</a></li>
					<li><a href="contact.jsp" rel="nofollow">食品安全</a></li>
					<c:if test="${empty user }">
		            <li><a href="login.jsp" rel="nofollow">登录</a></li>
		            </c:if>
		            <c:if test="${not empty user }">
		            <li class="login"><img alt="" src="${user.hdlUserLog } " style="width:50px;height: 50px;border-radius: 50%;position:relative;top:-5px;left:-10px"><span class="user" style="color:white;position:relative;top:-5px;">${user.hdlUserName }</span>
		            	<ul class="outlog">
		            	<li><a href="javascript:logout()" rel="nofollow">退出登录</a></li>
		            	<li><a href="order-1.let" rel="nofollow">个人中心</a></li>
		            	<%   HdlUser use=(HdlUser)request.getSession().getAttribute("user");
		            	if(use.getSysRoleId()==1){%>
		            		<li><a href="admin" rel="nofollow">系统管理</a></li>
		            	<%}
		            	%>
		            	
		            	</ul>
		            </li>
		            </c:if>
					<li><a href="reg.jsp" rel="nofollow">注册</a></li>
				</ul>
			</nav>
			<!--<div class="login" style="width: 50px; position: absolute; top: 10px;right: 10px;">
        	<div><a href="">登录</a></div>
        	<div><a href="">注册</a></div>
        </div>-->
	</section>


<%-- <%HdlUser user = (HdlUser) session.getAttribute("user");
	out.print(user.getHdlUserLog());
%> --%>

	<!-- 侧边栏内容 -->

	<div id="r-nav" class="am-offcanvas">
		<div class="am-offcanvas-bar am-offcanvas-bar-flip">
			<nav class="am-offcanvas-content">
				<a href="/" rel="nofollow"><span class="logo"></span></a>
				<p>
					<i class="am-icon-home"></i> <a href="index.jsp" rel="nofollow">首页</a>
				</p>
				<p>
					<i class="am-icon-desktop"></i> <a href="/anli.jsp" rel="nofollow">美食点餐</a>
				</p>
				<p>
					<i class="am-icon-cogs"></i> <a href="fuwu.jsp" rel="nofollow">服务中心</a>
				</p>
				<p>
					<i class="am-icon-credit-card"></i> <a href="zixun.jsp"
						rel="nofollow">最新动态</a>
				</p>

				<p>
					<i class="am-icon-user"></i> <a href="about.jsp" rel="nofollow">关于嗨底捞</a>
				</p>
				<p>
					<i class="am-icon-qq"></i> <a href="contact.jsp" rel="nofollow">加入嗨底捞</a>
				</p>
			</nav>
		</div>
	</div>
	<script>
	
	        $(function () {
				var ms=$("#meishi");
				
			    $.get(
			    		"type.let",
			    		{},
			    		function (data) {
						    $.each(data,function(i,obj){
						    	var li = "<li><a href='mallproduct.let?typeid="+obj.mallTypeId+"' rel='nofollow' >"+obj.mallTypeName+"</a></li>";
						    	ms.append(li);
						    	
						    })
						},"json"
			    		)
	        	
	        	
			})
			
			
			
	
			function logout(){
				
				$.post(
						"logout.let",
						{},
						function (data) {
							if(data.code == 1){//退出失败
								sys.toastr.warn("退出失败");
							}else{
								sys.toastr.success("退出成功");
								window.location="index.jsp";
							}
						}
				);
			};
	</script>
</header>